package com.example.lenovo.newsdemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class webViewActivity extends AppCompatActivity {
    private WebView news_webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_web_view);
        news_webView = findViewById(R.id.news_webView);

        String url = getIntent().getStringExtra("URL");

        news_webView.loadUrl(url);

        news_webView.setWebViewClient(new WebViewClient(){

         @Override
         public boolean shouldOverrideUrlLoading(WebView view, String url) {
             news_webView.loadUrl(url);
             return true;
         }
     });

    }
}
